home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F26056_CreateAttrSubset.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-10-04  |  1.0 KB  |  29 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- ===========================================================
  3.   Category:       XMLtoXML
  4.   Author:         David Silverlight
  5.                   HeadGeek@xmlpitstop.com
  6.   Created:        2001-05-16
  7.   Description:-
  8.     This stylsheet will create an output of a subset of
  9.     attributes.  Each element generated will contain only two
  10.     attributes from the original input element (CompanyName and
  11.     CustomerID).
  12. ================================================================ -->
  13. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml"/>
  14.  
  15. <xsl:template match="/">
  16.     <customers>
  17.     <xsl:apply-templates select="/customers/customer" />
  18.     </customers>
  19. </xsl:template>
  20.  
  21. <xsl:template match="customer">
  22.     <customer>
  23.         <xsl:attribute name="CompanyName" ><xsl:value-of select="@CompanyName"/></xsl:attribute>
  24.         <xsl:attribute name="CustomerID" ><xsl:value-of select="@CustomerID"/></xsl:attribute>
  25.     </customer>
  26.     <xsl:apply-templates/>
  27. </xsl:template>
  28.  
  29. </xsl:stylesheet>